﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Galateia.Infra.Config.Controls">

    <Style TargetType="{x:Type local:VerticalTabControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:VerticalTabControl}">
                    <ControlTemplate.Resources>
                        <Style TargetType="{x:Type TabItem}">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="{x:Type TabItem}">
                                        <Grid>
                                            <Border x:Name="Border" Background="White">
                                                <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Left" ContentSource="Header" Margin="12,6" />
                                            </Border>
                                        </Grid>
                                        <ControlTemplate.Triggers>
                                            <Trigger Property="IsSelected" Value="True">
                                                <Setter TargetName="Border" Property="Background" Value="LightBlue" />
                                            </Trigger>
                                            <Trigger Property="IsSelected" Value="False">
                                                <Setter TargetName="Border" Property="Background" Value="White" />
                                            </Trigger>
                                        </ControlTemplate.Triggers>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </ControlTemplate.Resources>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="{TemplateBinding HeaderWidth}" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <!-- ヘッダ -->
                        <StackPanel Grid.RowSpan="2" Grid.Column="0" Orientation="Vertical" IsItemsHost="true" />
                        <!-- コンテンツ -->
                        <ScrollViewer Grid.Row="0" Grid.Column="1" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"
                                      Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                            <ContentPresenter ContentSource="SelectedContent"/>
                        </ScrollViewer>
                        <!-- 右下パネル -->
                        <ContentPresenter Grid.Row="1" Grid.Column="1" Content="{TemplateBinding BottomOfContentToolPanel}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
